<?php

namespace App\Library\Requests\Base;

class CodeRequest extends BaseDTORequest
{
    public function rules(): array
    {
        return [
            'code' => 'required|string|size:32|regex:' . __('com.codeReg'),
            'state' => 'nullable|string|max:128',
        ];
    }

    public function messages(): array
    {
        return [
            'code.regex' => sprintf(__('com.codeTip'), 'code'),
        ];
    }
}
